<?php
class SetLayout extends Zend_Controller_Plugin_Abstract
{
		public function preDispatch()
		{
	
			$auth = Zend_Auth::getInstance()->getIdentity();
			$layout = Zend_Layout::getMvcInstance();
			$layout->setLayoutPath(APPLICATION_PATH ."/layouts");

			if($auth->status === 'admin' || $auth->status == 'demo_admin')
			{
				if($this->getRequest()->getModuleName() ==='admin'){
				$layout->setLayout('admin');

				}elseif($this->getRequest()->getModuleName() !=='admin'){
					$layout->setLayout('master');
				}
			}
			else{
					$layout->setLayout('master');
				}
		}
}
